# coding:utf-8

import string
import random

# words = string.ascii_lowercase + string.ascii_uppercase + string.digits + string.punctuation
# print('lower=', string.ascii_lowercase)
# print('upper=', string.ascii_uppercase)
# print('digit=', string.digits)
# print('punct=', string.punctuation)
# print('words=', words)
# len = int(input("请输入密码位数："))
# chosen = random.sample(words, len)
# print('chosen=', chosen)
# password = "".join(chosen)
# print('password=', password)

# 01.string
# print(dir(string))
# print('lettres=', string.ascii_letters)  # = lower + upper
# print('hexdigits=', string.hexdigits)
# print('octdigits=', string.octdigits)
# print('digits=', string.digits)
print('printable=', repr(string.printable))  # ?
print('whitespace=', repr(string.whitespace))  # ?

# ['Formatter', 'Template', '_ChainMap', '_TemplateMetaclass', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_re', '_string', 'ascii_letters', 'ascii_lowercase', 'ascii_uppercase', 'capwords', 'digits', 'hexdigits', 'octdigits', 'printable', 'punctuation', 'whitespace']
# lettres= abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
# hexdigits= 0123456789abcdefABCDEF
# octdigits= 01234567
# digits= 0123456789
# printable= '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'
# whitespace= ' \t\n\r\x0b\x0c'

# 02.random
# print(dir(random))
